<article class="module width_3_quarter">
    <header>
      <h3 class="tabs_involved">产品列表</h3>
        <ul class=" tabs">
     	<li><a href="admins.php?act=goods_list&cat_type=0">小区</a></li>
        <li><a href="admins.php?act=goods_list&cat_type=1">精益</a></li>
        <li>根据商品搜索：<input type="text"  name="goods_id" style="width:50px" value="商品ID" onclick="if(this.value=='商品ID') this.value=''"/> <input type="button" class="alt_btn" value="GO" onclick="ordrSearchByCatId()"/></li>
       <li><a href="admins.php?act=goods_list_export">导出</a></li>
      </ul>
    </header>
    <div class="tab_container">
      <div id="tab1" class="tab_content">
        <table class="tablesorter" cellspacing="0">
          <thead>
            <tr>
              
              <th width="20px">ID</th>
              <th>推荐</th>
              <th>排序</th>
              <th>加V</th>
               <th width="80px">图片</th>
              <th width="200px">案例名</th>
               <th>案例类别</th>
               
               <th>投产成本</th>
               <th>售价</th>
              <th>下载量</th>
               <th>好评</th>
              <th>点击量</th>
            
              <th width="120">操作</th>
            </tr>
          </thead>
          <tbody>
          {{foreach from=$goods_list item=list key=key}}
            <tr>
              <td>{{$list.goods_id}}</td>
               <td><input type="text" value="{{if $list.sort_order<10}}{{$list.sort_order}}{{/if}}" onblur="catSort(this.value,'{{$list.goods_id}}')" size="2"/></td>
                <td><input type="text" value="{{$list.sort}}" onblur="goodsSort(this.value,'{{$list.goods_id}}')" size="2"/></td>
               <td><input type="checkbox" {{if $list.goods_weight ==2}} checked="checked"{{/if}} onclick="catPlusV({{$list.goods_id}},this.checked)"/></td>
               <td><img src="{{$list.goods_thumb}}"  width="80"/></td>
              <td><a href="../goods.php?id={{$list.goods_id}}" target="_blank">{{$list.goods_name}}</a></td>
              <td>{{$list.goods_sn}}</td>
               <td>{{$list.market_priced}}</td>
              <td>{{$list.shop_priced}}</td>
              <td>{{$list.download}}</td>
              <td>{{$list.haoping}}</td>
              <td>{{$list.click_count}}</td>
             
              <td><a class="alt_btn" href="../{{$list.url}}" target="_blank">查看</a> / <a class="alt_btn" href="admins.php?act=goods_delete&goods_id={{$list.goods_id}}">删除</a></td>
              
            </tr>
          {{/foreach}}
          </tbody>
        </table>
      </div>
      <!-- end of #tab1 -->
      
 
    </div>
    <!-- end of .tab_container --> 
      {{include file="../../pages.htm"}} 
  </article>
  
  
  <script>
   function ordrSearchByCatId(){
	 var goods_id = $("input[name=goods_id]").val();
	 if(goods_id*1>0)
	 {
	 	$("#main").load('admins.php?act=goods_list&goods_id='+goods_id+' #main .module',{},function(res){
				$("#main").hide().fadeIn("slow");
		});
	 
	 }
	 else
	 {
		alert('请输入有效的ID');	 
	 }
	 
 }
function catSort(val,goods_id){
	var val = new Number(val);
	
	if(val*1>=0)
	{
		var data = "act=goods_sort&goods_id="+goods_id+"&sort="+val;
		Main.AJAX("admins.php",data);
	}
	else
	{
		alert("请输入数字");
	}
}

function goodsSort(val,goods_id){
	var val = new Number(val);
	
	if(val*1>=0)
	{
		var data = "act=sort&goods_id="+goods_id+"&sort="+val;
		Main.AJAX("admins.php",data);
	}
	else
	{
		alert("请输入数字");
	}
}
function catPlusV(goods_id,checked){

	if( checked)
	{
		var da = "act=goodsPlusV&goods_id="+goods_id+'&goods_weight=2';
		Main.AJAX("admins.php",da);
	}
	else
	{
		var da = "act=goodsPlusV&goods_id="+goods_id+'&goods_weight=0';
		Main.AJAX("admins.php",da);
	}
}


</script>